Introduction

In this script we are going to map T-cell subtypes onto the Visium slides.

Libraries

library(Seurat)
library(ggpubr)
library(cowplot)
library(dplyr)
library(ggplot2)
library(stringr)
library(readr)
library(SPOTlight)
library(SPATA2)

Setting parameters

Loading necessary paths and parameters

source(here::here("misc/paths.R"))
source(here::here("utils/bin.R"))

"{cd4}/{plt_dir}" %>%
  glue::glue() %>%
  here::here() %>%
  dir.create(path = ,
             showWarnings = FALSE,
             recursive = TRUE)

"{cd4}/{robj_dir}" %>%
  glue::glue() %>%
  here::here() %>%
  dir.create(path = ,
             showWarnings = FALSE,
             recursive = TRUE)

set.seed(123)

Extract sample id and get Donor ID

# sample_id <- params$sample_id
sample_id <- "esvq52_nluss5"
donor_id <- id_sp_df[id_sp_df$gem_id == sample_id, ] %>% dplyr::pull(donor_id)

Set gene dictionary

"{cd4}/gene_dict.R" %>%
  glue::glue() %>%
  here::here() %>%
  source(file = .)

Load data

We have 8 different datasets that we are going to analyze separately. The spatial data comes from the script 03-clustering/03-clustering_integration.Rmd while the sc data can be found in Ramon’s scRNAseq analysis: /scratch/devel/rmassoni/tonsil_atlas_private/2-DOWNSTREAM_PROCESSING/results/R_objects/processed_seurat_objects/processed_seurat_objects/tonsil_integrated_with_harmony_scrublet_annotated.rds.

sp_obj <- "{clust}/{robj_dir}/integrated_spatial_annotated.rds" %>%
  glue::glue() %>%
  here::here() %>%
  readRDS(file = .)

# Load SPOTlight data
spotlight_ls <- "{cd4}/{robj_dir}/spotlight_ls_cd4.rds" %>%
  glue::glue() %>% 
  here::here() %>%
  readRDS(file = .)

Load MAGIC data from the script MAGIC_denoising.Rmd

magic_df <- "{cd4}/{robj_dir}/MAGIC-mtrx.rds" %>%
  glue::glue() %>%
  here::here() %>%
  readRDS(file = .)

# create a new assay to store ADT information
magic_assay <- CreateAssayObject(counts = as.matrix(magic_df))

# add this assay to the previously created Seurat object
sp_obj[["MAGIC_Spatial"]] <- magic_assay

Seurat::DefaultAssay(sp_obj) <- "MAGIC_Spatial"

Add colors to cell types

col_vec <- c(
  "Naive" = "gray88",
  "CM Pre-non-Tfh" = "gray71",
  "CM PreTfh" = "gray59",
  "Tfh T:B border" = "#67a9cf",
  "Tfh-LZ-GC" = "#3690c0",
  "GC-Tfh-SAP" = "#02818a",
  "GC-Tfh-0X40"= "#016c59",
  "Tfh-Mem" = "#014636",
  "T-Trans-Mem" = "#fd8d3c",
  "T-Eff-Mem" = "#e31a1c",
  "T-helper" = "#800026",
  "Eff-Tregs" = "#df65b0",
  "non-GC-Tf-regs" = "#e7298a",
  "GC-Tf-regs" = "#ce1256"
)

(nm_df <- data.frame(col_vec))
##                col_vec
## Naive           gray88
## CM Pre-non-Tfh  gray71
## CM PreTfh       gray59
## Tfh T:B border #67a9cf
## Tfh-LZ-GC      #3690c0
## GC-Tfh-SAP     #02818a
## GC-Tfh-0X40    #016c59
## Tfh-Mem        #014636
## T-Trans-Mem    #fd8d3c
## T-Eff-Mem      #e31a1c
## T-helper       #800026
## Eff-Tregs      #df65b0
## non-GC-Tf-regs #e7298a
## GC-Tf-regs     #ce1256
nm_df$plt_nm <- rownames(nm_df)
nm_df$mod_nm <- stringr::str_replace_all(
  string = rownames(nm_df),
  pattern = "[[:punct:]]|[[:space:]]",
  replacement = ".")

Analysis

Preprocess data

decon_mtrx <- spotlight_ls[[2]]
decon_mtrx <- decon_mtrx[, colnames(decon_mtrx) != "res_ss"]

# Set as 0 cell types predicted to be under 1 % of the spot
# decon_mtrx[decon_mtrx < 0.03] <- 0

Change column names

new_cn <- data.frame(mod_nm = colnames(decon_mtrx)) %>%
  dplyr::left_join(nm_df, by = "mod_nm") %>%
  dplyr::mutate(plt_nm = dplyr::if_else(is.na(plt_nm), mod_nm, plt_nm)) %>%
  dplyr::distinct() %>%
  dplyr::pull(plt_nm)

colnames(decon_mtrx) <- new_cn

We are going to add the deconvolution to the Seurat object.

sp_obj@meta.data <- cbind(sp_obj@meta.data, decon_mtrx)

Subset sample of interest

sp_sub <- sp_obj[, sp_obj@meta.data$gem_id == sample_id]
sp_sub@images <- sp_sub@images[Seurat::Images(sp_sub) == sample_id]

Look at SPOTlight results

Check Topic profiles

nmf_mod_ls <- spotlight_ls[[1]]
nmf_mod <- nmf_mod_ls[[1]]

h <- NMF::coef(nmf_mod)
rownames(h) <- paste("Topic", 1:nrow(h), sep = "_")
topic_profile_plts <- SPOTlight::dot_plot_profiles_fun(
  h = h,
  train_cell_clust = nmf_mod_ls[[2]])

topic_profile_plts[[2]] +
  ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 90), 
                 axis.text = ggplot2::element_text(size = 12))

Look at all cells profiles

topic_profile_plts[[1]] +
  ggplot2::theme(
    axis.text.y = ggplot2::element_blank(),
    axis.text.x = ggplot2::element_blank(),
    axis.title = ggplot2::element_blank())

Look at cells topic profile

basis_spotlight <- data.frame(NMF::basis(spotlight_ls[[1]][[1]]))

train_labs <- spotlight_ls[[1]][[2]]
colnames(basis_spotlight) <- unique(stringr::str_wrap(train_labs, width = 30))

basis_spotlight[basis_spotlight < 0.0000001] <- 0

DT::datatable(basis_spotlight, filter = "top")

Cell type location

Look at the location of each cell type in each slice separately

# Iterate over cell types
ct <- colnames(decon_mtrx)

# Iterate over images
lapply(names(sp_obj@images), function(nm) {
  print(nm)
  nm_donor <- id_sp_df %>% dplyr::filter(gem_id == nm) %>% dplyr::pull(donor_id)
  # Iterate over cell types
  ct_plt_ls <- lapply(ct, function(i) {
    tmp_plt <- Seurat::SpatialFeaturePlot(
      object = sp_obj,
      features = i,
      alpha = c(0, 1),
      images = nm) +
      ggplot2::scale_fill_gradientn(
        colors = heat.colors(10, rev = TRUE)) +
      ggplot2::scale_alpha(range = c(0, 1)) +
      ggplot2::labs(title = stringr::str_wrap(string = i,
                                     width = 25),
           fill = "") +
      ggplot2::theme(
        plot.title = ggplot2::element_text(
          hjust = 0.5,
          size = 20,
          face = "bold"))
    
    if (sum(sp_sub@meta.data[, i]) == 0) {
      tmp_plt <- suppressMessages(tmp_plt + ggplot2::scale_alpha(range = c(0,0)))
    }
    
    return(tmp_plt)
  })
  
  (plt_arr <- cowplot::plot_grid(
    plotlist = ct_plt_ls,
    axis = "trbl",
    align = "hv",
    nrow = 5,
    ncol = 5))
  
  "{cd4}/{plt_dir}/cell_type_location_cd4_{nm_donor}.pdf" %>%
    glue::glue() %>%
    here::here() %>%
    cowplot::save_plot(
      filename = .,
      plot = plt_arr,
      base_height = 25,
      base_width = 25)
  })
## [1] "tarwe1_xott6q"
## [1] "c28w2r_7jne4i"
## [1] "esvq52_nluss5"
## [1] "p7hv1g_tjgmyj"
## [1] "gcyl7c_cec61b"
## [1] "zrt7gl_lhyyar"
## [1] "qvwc8t_2vsr67"
## [1] "exvyh1_66caqq"
## [[1]]
## [1] "/scratch/devel/melosua/phd/projects/BCLLatlas/tonsil_atlas/spatial_transcriptomics/CD4-Analysis/2020-09-22/plots_2020-09-22/cell_type_location_cd4_BCLL-2-T.pdf"
## 
## [[2]]
## [1] "/scratch/devel/melosua/phd/projects/BCLLatlas/tonsil_atlas/spatial_transcriptomics/CD4-Analysis/2020-09-22/plots_2020-09-22/cell_type_location_cd4_BCLL-8-T.pdf"
## 
## [[3]]
## [1] "/scratch/devel/melosua/phd/projects/BCLLatlas/tonsil_atlas/spatial_transcriptomics/CD4-Analysis/2020-09-22/plots_2020-09-22/cell_type_location_cd4_BCLL-10-T.pdf"
## 
## [[4]]
## [1] "/scratch/devel/melosua/phd/projects/BCLLatlas/tonsil_atlas/spatial_transcriptomics/CD4-Analysis/2020-09-22/plots_2020-09-22/cell_type_location_cd4_BCLL-12-T.pdf"
## 
## [[5]]
## [1] "/scratch/devel/melosua/phd/projects/BCLLatlas/tonsil_atlas/spatial_transcriptomics/CD4-Analysis/2020-09-22/plots_2020-09-22/cell_type_location_cd4_BCLL-13-T.pdf"
## 
## [[6]]
## [1] "/scratch/devel/melosua/phd/projects/BCLLatlas/tonsil_atlas/spatial_transcriptomics/CD4-Analysis/2020-09-22/plots_2020-09-22/cell_type_location_cd4_BCLL-14-T.pdf"
## 
## [[7]]
## [1] "/scratch/devel/melosua/phd/projects/BCLLatlas/tonsil_atlas/spatial_transcriptomics/CD4-Analysis/2020-09-22/plots_2020-09-22/cell_type_location_cd4_BCLL-9-T.pdf"
## 
## [[8]]
## [1] "/scratch/devel/melosua/phd/projects/BCLLatlas/tonsil_atlas/spatial_transcriptomics/CD4-Analysis/2020-09-22/plots_2020-09-22/cell_type_location_cd4_BCLL-11-T.pdf"

Cell type - Gene

Look at correlation between cell types and markers

sp_sub <- sp_obj[, sp_obj@meta.data$gem_id == sample_id]
sp_sub@images <- sp_sub@images[Seurat::Images(sp_sub) == sample_id]
scatterplot2 <- function(se_obj, x, y, color) {
  df <- data.frame(
    feat1 = se_obj@assays$MAGIC_Spatial@data[x, ],
    feat2 = se_obj@meta.data[, y],
    color = se_obj@meta.data[, color]
    )
  
  ggplot2::ggplot(df,
                  ggplot2::aes(x = feat1,
                               y = feat2)) +
    ggplot2::geom_point(ggplot2::aes(color = color)) +
    ggplot2::geom_smooth(method = "loess", se = FALSE) +
    # ggplot2::geom_smooth(method = lm, se = FALSE) +
    ggplot2::theme_classic() +
    ggplot2::labs(
      x = x,
      y = glue::glue("Proportion of\n{y}"),
      color = color)

}

BCL6

bcl6_ls <- lapply(ct, function(ii) {
  scatterplot2(
    se_obj = sp_sub,
    x = "BCL6",
    y = ii,
    color = "annotation")
})

patchwork::wrap_plots(bcl6_ls, ncol = 5) +
  patchwork::plot_layout(guides = "collect") &
  ggplot2::theme(legend.position = "right")

PRDM1

prdm1_ls <- lapply(ct, function(ii) {
  scatterplot2(
    se_obj = sp_sub,
    x = "PRDM1",
    y = ii,
    color = "annotation")
})

patchwork::wrap_plots(prdm1_ls, ncol = 5) +
  patchwork::plot_layout(guides = "collect") &
  ggplot2::theme(legend.position = "right")

TCF7

tcf7_ls <- lapply(ct, function(ii) {
  scatterplot2(
    se_obj = sp_sub,
    x = "TCF7",
    y = ii,
    color = "annotation")
})

patchwork::wrap_plots(tcf7_ls, ncol = 5) +
  patchwork::plot_layout(guides = "collect") &
  ggplot2::theme(legend.position = "right")

LEF1

lef1_ls <- lapply(ct, function(ii) {
  scatterplot2(
    se_obj = sp_sub,
    x = "LEF1",
    y = ii,
    color = "annotation")
})

patchwork::wrap_plots(lef1_ls, ncol = 5) +
  patchwork::plot_layout(guides = "collect") &
  ggplot2::theme(legend.position = "right")

CXCR5

cxcr5_ls <- lapply(ct, function(ii) {
  scatterplot2(
    se_obj = sp_sub,
    x = "CXCR5",
    y = ii,
    color = "annotation")
})

patchwork::wrap_plots(cxcr5_ls, ncol = 5) +
  patchwork::plot_layout(guides = "collect") &
  ggplot2::theme(legend.position = "right")

T cell markers

Seurat::SpatialFeaturePlot(
  object = sp_obj,
  features = c("CD3D", "CD4", "CD8A", "CD8B"),
  alpha = c(0, 1),
  images = "esvq52_nluss5",
  slot = "data") |
    Seurat::SpatialFeaturePlot(
    object = sp_obj,
    features = c("Cytotoxic", "Naive"),
    alpha = c(0, 1),
    images = "esvq52_nluss5")

Correlation between markers

(scatterplot(se_obj = sp_sub, x = "CD4", y = "CD8A", color = "annotation") |
  scatterplot(se_obj = sp_sub, x = "CD4", y = "CD3D", color = "annotation")) /
  (scatterplot(se_obj = sp_sub, x = "CD8A", y = "CD3D", color = "annotation") | 
  scatterplot(se_obj = sp_sub, x = "CD4", y = "CXCR5", color = "annotation")) +
  patchwork::plot_layout(guides = "collect") &
  ggplot2::theme(legend.position = "right")

Boxplots

Prepare data for boxplots

metadata_long <- sp_sub@meta.data %>% 
  # tidyr::pivot_longer(cols = c("annotation"),
  #                     names_to = "stratification_id",
  #                     values_to = "stratification_val") %>%
  tidyr::pivot_longer(cols = all_of(ct), names_to = "ct_key", values_to = "ct_val") %>%
  # dplyr::left_join(col_df, by = c("ct_key" = "ct_name")) %>%
  dplyr::mutate(ct_val = dplyr::if_else(ct_val > 0.001, ct_val, 0))

Box plot of cell type proportion between stratified regions showing the unadjusted ANOVA Pvalue

keep_ct <- metadata_long %>%
  dplyr::group_by(ct_key) %>%
  dplyr::summarise(prop_sum = sum(ct_val)) %>% 
  dplyr::filter(prop_sum > 0) %>%
  dplyr::pull(ct_key)

(bplt <- metadata_long %>%
  dplyr::filter(ct_key %in% keep_ct) %>%
  dplyr::mutate(
    ct_key = stringr::str_wrap(string = ct_key,
                                   width = 30)) %>%
  # dplyr::mutate(stratification_val = factor(stratification_val, 
  #                                           levels = c("Fibrotic", "HER2+/ESR1+",
  #                                                      "HER2+/ESR1-", "HER2-/ESR1+",
  #                                                      "HER2-/ESR1-"))) %>%
  # dplyr::filter(! plt_name %in% c("CD8 EM-like", "CD4 naive-like")) %>%
  ggpubr::ggboxplot(data = .,
                    x = "annotation",
                    y = "ct_val",
                    facet.by = "ct_key",
                    color = "annotation",
                    fill = "annotation",
                    add = "jitter",
                    scales = "free",
                    repel = TRUE,
                    outlier.shape = NA,
                    alpha = 0.6,
                    palette = "Set1",
                    ncol = 6) +
  ggplot2::theme(
    strip.text = ggplot2::element_text(size = 18, face = "bold"),
    axis.text.y = ggplot2::element_text(size = 16),
    axis.title.y = ggplot2::element_text(size = 20),
    # axis.text.x = element_text(size = 12, angle = 90, vjust = 0.5, hjust = 0.5),
    axis.text.x = ggplot2::element_blank(),
    legend.text = ggplot2::element_text(size = 18),
    legend.title = ggplot2::element_blank(),
    strip.background = ggplot2::element_blank()) +
  ggplot2::labs(
    y = "Proportion",
    color = "Regions",
    fill = "Regions"))

# bplt <- bplt +
#   ggpubr::stat_compare_means(method = "anova", size = 6) +
#   ggplot2::scale_y_continuous(
#     expand = expansion(mult = c(0, 0.1)),
#     labels = function(x) sprintf("%.2f", x))

"{cd4}/{plt_dir}/strat_bplot_{donor_id}.pdf" %>%
  glue::glue() %>%
  here::here() %>%
  cowplot::save_plot(
    filename = .,
    plot = bplt,
    base_height = 20,
    base_width = 25)

Genes of interest

Seurat::DefaultAssay(sp_obj) <- "Spatial"

Seurat::SpatialFeaturePlot(
  object = sp_obj,
  features = c("KLRB1", "PRDM1"),
  ncol = 2,
  images = "esvq52_nluss5",
  alpha = c(0, 1))

Integrated UMAP

Seurat::DimPlot(
  object = sp_obj,
  group.by = c("annotation", "sample_id"))

Next we want to look at the piecharts in the UMAP

# Loading libraries
suppressMessages(require(ggplot2))
suppressMessages(require(dplyr))
suppressMessages(require(tibble))
suppressMessages(require(grid))


metadata_ds <- data.frame(sp_obj@meta.data)

colnames(metadata_ds) <- colnames(sp_obj@meta.data)
cell_types_all <- ct
cell_types_interest <- cell_types_all

# If not all cell types are in the cell types of interest we only want to keep those spots which have at least one of the cell types of interest
if (!all(cell_types_all %in% cell_types_interest)) {

  metadata_ds <- metadata_ds %>%
    tibble::rownames_to_column("barcodeID") %>%
    dplyr::mutate(rsum = base::rowSums(.[, cell_types_interest,
                                         drop = FALSE])) %>%
    dplyr::filter(rsum != 0) %>%
    dplyr::select("barcodeID") %>%
    dplyr::left_join(metadata_ds %>% tibble::rownames_to_column("barcodeID"),
                     by = "barcodeID") %>%
    tibble::column_to_rownames("barcodeID")
}

## Preprocess data
umap_coord <- data.frame(sp_obj@reductions$umap@cell.embeddings[, c("UMAP_1", "UMAP_2")]) %>%
  tibble::rownames_to_column("barcodeID") %>%
  dplyr::inner_join(metadata_ds %>% tibble::rownames_to_column("barcodeID"),
                    by = "barcodeID")

## Plot spatial scatterpie plot
(umap_pie_plt <- ggplot2::ggplot() +
    scatterpie::geom_scatterpie(
      data = umap_coord,
      ggplot2::aes(
        x = UMAP_1,
        y = UMAP_2),
      # Fill the pie chart
      cols = cell_types_all,
      pie_scale = 0.15,
      # Remove black outline
      color = NA) +
    ggplot2::scale_fill_manual(
      breaks = col_df$plt_nm,
      values = col_df$color))

"{cd4}/{plt_dir}/UMAP_piehcart_integrated.pdf" %>%
  glue::glue() %>%
  here::here() %>%
  cowplot::save_plot(
    filename = .,
    plot = umap_pie_plt,
    base_height = 20,
    base_width = 25)

Cell type correlation matrix

# se_sub <- subset(merged_se, subset = gem_id == "esvq52_nluss5")
# se_sub
# se_sub@images <- se_sub@images[Seurat::Images(se_sub) == "esvq52_nluss5"]

(cor_mtrx_ct <- SCrafty::correlation_heatmap( 
  se = sp_obj,
  feats = ct,
  assay = "MAGIC_Spatial",
  slot = "data") +
   ggplot2::labs(
     title = "Integrated cell-type correlation matrix"))

"{cd4}/{plt_dir}/magic_cor-mtrx_cell-type_integrated.pdf" %>%
  glue::glue() %>%
  here::here() %>%
  cowplot::save_plot(
    filename = .,
    plot = cor_mtrx_ct,
    base_height = 9,
    base_width = 10)

Cell type trajectories

Lastly we also want to take a look at how the cell-type vary over the trajectories previously defined.

Load drawn trajectories on slide esvq52_nluss5

spata_sub <- "{anot}/{robj_dir}/spata-esvq52_nluss5.rds" %>%
  glue::glue() %>%
  here::here() %>%
  readRDS(file = .)

Add cell type proportions to it:

decon_mtrx_t <- t(decon_mtrx)
colnames(decon_mtrx_t) <- colnames(sp_obj)

spata_sub <- SPATA2::addExpressionMatrix(
  object = spata_sub,
  expr_mtr = decon_mtrx_t,
  mtr_name = "decomp")

# Set as active assay
spata_sub <- SPATA2::setActiveExpressionMatrix(
  object = spata_sub,
  mtr_name = "decomp")

Look at all the genes in gene vec in the heat map

hm_colors <- viridis::inferno(n = 100)

SPATA2::plotTrajectoryHeatmap(
  object = spata_sub,
  trajectory_name = "Tfh-migration",
  variables = ct,
  arrange_rows = "maxima",
  colors = hm_colors,
  show_rownames = TRUE,
  split_columns = TRUE, 
  smooth_span = 0.5)

SPATA2::plotTrajectoryHeatmap(
  object = spata_sub,
  trajectory_name = "Tfh-migration-quiescent",
  variables = ct,
  arrange_rows = "maxima",
  colors = hm_colors,
  show_rownames = TRUE,
  split_columns = TRUE, 
  smooth_span = 0.5)

Session Info

sessionInfo()
## R version 4.0.1 (2020-06-06)
## Platform: x86_64-conda_cos6-linux-gnu (64-bit)
## Running under: Red Hat Enterprise Linux Server release 6.7 (Santiago)
## 
## Matrix products: default
## BLAS/LAPACK: /scratch/groups/hheyn/software/anaconda3/envs/spatial_r/lib/libopenblasp-r0.3.12.so
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=es_ES.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=es_ES.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=es_ES.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=es_ES.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] parallel  stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] tidyr_1.1.4         tibble_3.1.6        Biobase_2.50.0      BiocGenerics_0.36.1 SPATA2_0.1.0        SPOTlight_0.1.7     readr_2.1.1         stringr_1.4.0       dplyr_1.0.7         cowplot_1.1.1       ggpubr_0.4.0        ggplot2_3.3.5       SeuratObject_4.0.4  Seurat_4.0.5       
## 
## loaded via a namespace (and not attached):
##   [1] utf8_1.2.2                  reticulate_1.22             tidyselect_1.1.1            htmlwidgets_1.5.4           grid_4.0.1                  Rtsne_0.15                  munsell_0.5.0               codetools_0.2-18            ica_1.0-2                   DT_0.20                     future_1.23.0               miniUI_0.1.1.1              withr_2.4.3                 colorspace_2.0-2            highr_0.9                   knitr_1.36                  stats4_4.0.1                SingleCellExperiment_1.12.0 ROCR_1.0-11                 ggsignif_0.6.3              tensor_1.5                  listenv_0.8.0               NMF_0.23.0                  MatrixGenerics_1.2.1        labeling_0.4.2              GenomeInfoDbData_1.2.4      polyclip_1.10-0             pheatmap_1.0.12             bit64_4.0.5                 farver_2.1.0                rprojroot_2.0.2             parallelly_1.29.0           vctrs_0.3.8                 generics_0.1.1              xfun_0.28                   R6_2.5.1                    doParallel_1.0.16           GenomeInfoDb_1.26.7         bitops_1.0-7                spatstat.utils_2.2-0        DelayedArray_0.16.3         assertthat_0.2.1           
##  [43] promises_1.2.0.1            scales_1.1.1                vroom_1.5.7                 gtable_0.3.0                globals_0.14.0              goftest_1.2-3               rlang_0.4.12                splines_4.0.1               rstatix_0.7.0               lazyeval_0.2.2              spatstat.geom_2.3-0         broom_0.7.10                yaml_2.2.1                  reshape2_1.4.4              abind_1.4-5                 crosstalk_1.2.0             backports_1.4.0             httpuv_1.6.3                tools_4.0.1                 gridBase_0.4-7              ellipsis_0.3.2              spatstat.core_2.3-2         jquerylib_0.1.4             RColorBrewer_1.1-2          ggridges_0.5.3              Rcpp_1.0.7                  plyr_1.8.6                  progress_1.2.2              zlibbioc_1.36.0             purrr_0.3.4                 RCurl_1.98-1.5              prettyunits_1.1.1           rpart_4.1-15                deldir_1.0-6                pbapply_1.5-0               viridis_0.6.2               S4Vectors_0.28.1            zoo_1.8-9                   SummarizedExperiment_1.20.0 ggrepel_0.9.1               cluster_2.1.2               here_1.0.1                 
##  [85] magrittr_2.0.1              data.table_1.14.2           scattermore_0.7             lmtest_0.9-39               RANN_2.6.1                  fitdistrplus_1.1-6          matrixStats_0.61.0          hms_1.1.1                   patchwork_1.1.1             mime_0.12                   evaluate_0.14               xtable_1.8-4                IRanges_2.24.1              gridExtra_2.3               compiler_4.0.1              KernSmooth_2.23-20          crayon_1.4.2                htmltools_0.5.2             mgcv_1.8-38                 later_1.3.0                 tzdb_0.2.0                  lubridate_1.8.0             DBI_1.1.1                   corrplot_0.92               MASS_7.3-54                 Matrix_1.3-4                car_3.0-12                  cli_3.1.0                   SCrafty_0.1.0               igraph_1.2.9                GenomicRanges_1.42.0        pkgconfig_2.0.3             registry_0.5-1              confuns_0.1.0               plotly_4.10.0               spatstat.sparse_2.0-0       foreach_1.5.1               bslib_0.3.1                 ggcorrplot_0.1.3            rngtools_1.5.2              pkgmaker_0.32.2             XVector_0.30.0             
## [127] digest_0.6.29               sctransform_0.3.2           RcppAnnoy_0.0.19            spatstat.data_2.1-0         rmarkdown_2.11              leiden_0.3.9                uwot_0.1.11                 shiny_1.7.1                 lifecycle_1.0.1             nlme_3.1-153                jsonlite_1.7.2              carData_3.0-4               viridisLite_0.4.0           fansi_0.5.0                 pillar_1.6.4                lattice_0.20-45             fastmap_1.1.0               httr_1.4.2                  survival_3.2-13             glue_1.5.1                  png_0.1-7                   iterators_1.0.13            bit_4.0.4                   stringi_1.7.6               sass_0.4.0                  irlba_2.3.4                 future.apply_1.8.1